<?php

class Users_Form_Login extends Zend_Form {

    public function init() {
        $this->setAction('/user/login')
                ->setMethod('post')
                ->setAttribs(array('id'=>'login'));
                


        //username
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email')
                ->setOptions(array('placeholder' => 'Verified Email Id'))
                ->setRequired(true)
                ->addFilter('StringToLower')
                ->addValidator('EmailAddress')
                ->addFilter('stringTrim');
        //password
        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password')
                ->addValidator('StringLength', false, array(6))
                ->setOptions(array('placeholder' => 'Min. 6 character'))
                ->setRequired(true);
        
        //submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Sign In')
                ->setOptions(array('class' => 'submit'))
                ->setAttrib('class', 'btn btn-success');
        
        //
        $this->addElements(array($email, $password,$submit));
        $this->addDisplayGroup(array('email','password','submit'),'lg');
        $this->getDisplayGroup('lg')
                ->setLegend('Login');
                
    }

}

